<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>uCXpresso.BLE: bleSerial Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../upnp.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">uCXpresso.BLE
   &#160;<span id="projectnumber">v1.0.4</span>
   </div>
   <div id="projectbrief">RTOS C++ Framework for Bluetooth Low Energy</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="../../classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="../../hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="../../functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d7/d03/classble_serial.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="../../da/dc5/classble_serial-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">bleSerial Class Reference<div class="ingroups"><a class="el" href="../../df/daf/group___b_l_e.html">BLE</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> class is a ble core, and inherits from <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a> class to provide the stream virtual functions for serial input and output. the <a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> class also inherits from the <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> class and can be work in background.  
 <a href="../../d7/d03/classble_serial.html#details">More...</a></p>

<p><code>#include &quot;<a class="el" href="../../dd/d5c/ble__serial_8h_source.html">class/ble_serial.h</a>&quot;</code></p>
<div class="dynheader">
Inheritance diagram for bleSerial:</div>
<div class="dyncontent">
 <div class="center">
  <img src="../../d7/d03/classble_serial.png" usemap="#bleSerial_map" alt=""/>
  <map id="bleSerial_map" name="bleSerial_map">
<area href="../../d4/d16/class_c_stream.html" alt="CStream" shape="rect" coords="0,56,62,80"/>
<area href="../../d0/d26/class_c_thread.html" alt="CThread" shape="rect" coords="72,56,134,80"/>
<area href="../../dc/dac/class_c_object.html" alt="CObject" shape="rect" coords="0,0,62,24"/>
<area href="../../dc/dac/class_c_object.html" alt="CObject" shape="rect" coords="72,0,134,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a835c884c9209b074cf82e5a3f0a322ec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a835c884c9209b074cf82e5a3f0a322ec">bleSerial</a> (LPCTSTR deviceName=DEF_BLE_DEVICENAME)</td></tr>
<tr class="memdesc:a835c884c9209b074cf82e5a3f0a322ec"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> constructor with a GAT device name.  <a href="#a835c884c9209b074cf82e5a3f0a322ec">More...</a><br/></td></tr>
<tr class="separator:a835c884c9209b074cf82e5a3f0a322ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ee4ea2d6d4a38bbd64968336f85c2e9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a0ee4ea2d6d4a38bbd64968336f85c2e9">advertising</a> (uint16_t advInterval, int8_t txPowerLevel=DEF_BLE_TXPOWER, uint16_t connInterval=DEF_BLE_CONN_INTERVAL, uint16_t connTimeout=DEF_BLE_CONN_TIMEOUT, uint16_t manufactureData=DEF_BLE_MFG_DATA)</td></tr>
<tr class="separator:a0ee4ea2d6d4a38bbd64968336f85c2e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc1e214474c9e98705fb7f363a3eee74"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#acc1e214474c9e98705fb7f363a3eee74">setup</a> (uint16_t advInterval, int8_t txPowerLevel=DEF_BLE_TXPOWER, uint16_t connInterval=DEF_BLE_CONN_INTERVAL, uint16_t connTimeout=DEF_BLE_CONN_TIMEOUT, uint16_t manufactureData=DEF_BLE_MFG_DATA)</td></tr>
<tr class="separator:acc1e214474c9e98705fb7f363a3eee74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ff1e4b271a7d225e73abd337043d8e4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a3ff1e4b271a7d225e73abd337043d8e4">enable</a> (uint32_t stack=128)</td></tr>
<tr class="separator:a3ff1e4b271a7d225e73abd337043d8e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08b3a82e95aa527433c04b4a6a3d81d4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a08b3a82e95aa527433c04b4a6a3d81d4">disable</a> ()</td></tr>
<tr class="separator:a08b3a82e95aa527433c04b4a6a3d81d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2588b21bf80d35a866dc7e47f97142df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a2588b21bf80d35a866dc7e47f97142df">watchdog</a> (uint32_t tm)</td></tr>
<tr class="separator:a2588b21bf80d35a866dc7e47f97142df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e63823fd7ff0ef0ac5447cd265b5a5c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a5e63823fd7ff0ef0ac5447cd265b5a5c">disconnect</a> (<a class="el" href="../../db/dff/group___enumerations.html#gafdc7d73c1364c4d42f80cfdc702de294">BLE_DISCONNECT_REASON_T</a> reason=<a class="el" href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a3aaba90cbef710f140a4f7e70d1f0d5b">BLE_TERMINATED</a>)</td></tr>
<tr class="separator:a5e63823fd7ff0ef0ac5447cd265b5a5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acddad359ad714bd31358c96966839a61"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#acddad359ad714bd31358c96966839a61">setRadioTxPower</a> (<a class="el" href="../../db/dff/group___enumerations.html#ga3b6d6db9e13e93ae21f2a383d9903617">BLE_TX_POWER_T</a> power)</td></tr>
<tr class="separator:acddad359ad714bd31358c96966839a61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6aea16b265aa98f0a540f71b75965408"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a6aea16b265aa98f0a540f71b75965408">getPhyVersion</a> ()</td></tr>
<tr class="separator:a6aea16b265aa98f0a540f71b75965408"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb930ce55295ff7eb6ab5bdbeb702749"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#adb930ce55295ff7eb6ab5bdbeb702749">onConnected</a> ()</td></tr>
<tr class="separator:adb930ce55295ff7eb6ab5bdbeb702749"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6f5116c8bcf05011a05ad5e2967c318"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#aa6f5116c8bcf05011a05ad5e2967c318">onDisconnected</a> ()</td></tr>
<tr class="separator:aa6f5116c8bcf05011a05ad5e2967c318"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8af315789cc459a1fde96ac80ca9ffb7"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a8af315789cc459a1fde96ac80ca9ffb7">onWatchdog</a> ()</td></tr>
<tr class="separator:a8af315789cc459a1fde96ac80ca9ffb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a0622f5d10fe2242978a16b2d1e6ee4"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a8a0622f5d10fe2242978a16b2d1e6ee4">onError</a> (<a class="el" href="../../db/dff/group___enumerations.html#ga6c00522f6a8c33135ee0414877d42c04">BLE_ERR_T</a> err, LPCTSTR id=&quot;bleSerial&quot;)</td></tr>
<tr class="separator:a8a0622f5d10fe2242978a16b2d1e6ee4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1691c5c5655043512bf1c462e6928488"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a1691c5c5655043512bf1c462e6928488">isAvailable</a> ()</td></tr>
<tr class="separator:a1691c5c5655043512bf1c462e6928488"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59dca8e3e2d6945a699347f4c4708fd4"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a59dca8e3e2d6945a699347f4c4708fd4">readable</a> ()</td></tr>
<tr class="separator:a59dca8e3e2d6945a699347f4c4708fd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac42a8f805e6784e0fa2064270b5288a1"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#ac42a8f805e6784e0fa2064270b5288a1">writeable</a> ()</td></tr>
<tr class="separator:ac42a8f805e6784e0fa2064270b5288a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a186e09706d9b6e58a6213ac0b6a220ad"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#a186e09706d9b6e58a6213ac0b6a220ad">read</a> (void *buf, int len, bool block=true)</td></tr>
<tr class="separator:a186e09706d9b6e58a6213ac0b6a220ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9d147e7dcb9436f390f2ad29d539930"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#ab9d147e7dcb9436f390f2ad29d539930">write</a> (const void *buf, int len, bool block=true)</td></tr>
<tr class="separator:ab9d147e7dcb9436f390f2ad29d539930"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebfde0d9a7583cb641ac60f02df7cd77"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#aebfde0d9a7583cb641ac60f02df7cd77">isConnected</a> ()</td></tr>
<tr class="separator:aebfde0d9a7583cb641ac60f02df7cd77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad41b78cc1b0fc02ce65248147b32ffa8"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d03/classble_serial.html#ad41b78cc1b0fc02ce65248147b32ffa8">flush</a> ()</td></tr>
<tr class="separator:ad41b78cc1b0fc02ce65248147b32ffa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af56764abe8954430eede10e253f8994f"><td class="memItemLeft" align="right" valign="top">virtual uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d16/class_c_stream.html#af56764abe8954430eede10e253f8994f">read</a> ()</td></tr>
<tr class="separator:af56764abe8954430eede10e253f8994f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48041fea5cad32feaeef543bcaa2d37d"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d16/class_c_stream.html#a48041fea5cad32feaeef543bcaa2d37d">write</a> (uint8_t c)</td></tr>
<tr class="separator:a48041fea5cad32feaeef543bcaa2d37d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c6130bd65b00f278045d8b7b8ea7f84"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d16/class_c_stream.html#a2c6130bd65b00f278045d8b7b8ea7f84">operator&lt;&lt;</a> (uint8_t c)</td></tr>
<tr class="separator:a2c6130bd65b00f278045d8b7b8ea7f84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2f2d74f0924caa2e863d049fe9ada80"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d16/class_c_stream.html#ad2f2d74f0924caa2e863d049fe9ada80">operator&lt;&lt;</a> (<a class="el" href="../../d4/d16/class_c_stream.html">CStream</a> &amp;s)</td></tr>
<tr class="separator:ad2f2d74f0924caa2e863d049fe9ada80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2bd1778d5f5cfab469e5df615e1c8fc"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d16/class_c_stream.html#af2bd1778d5f5cfab469e5df615e1c8fc">operator&gt;&gt;</a> (uint8_t c)</td></tr>
<tr class="separator:af2bd1778d5f5cfab469e5df615e1c8fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acbaa22d4608c1a015a20104fde6c8ccf"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d16/class_c_stream.html#acbaa22d4608c1a015a20104fde6c8ccf">operator uint8_t</a> ()</td></tr>
<tr class="separator:acbaa22d4608c1a015a20104fde6c8ccf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc833c2eea18af67b57ba641ec58fea7"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d16/class_c_stream.html#acc833c2eea18af67b57ba641ec58fea7">operator char</a> ()</td></tr>
<tr class="separator:acc833c2eea18af67b57ba641ec58fea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26a76c241a4d62d2efdac57d2cfe4c0f"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dac/class_c_object.html#a26a76c241a4d62d2efdac57d2cfe4c0f">isThread</a> ()</td></tr>
<tr class="separator:a26a76c241a4d62d2efdac57d2cfe4c0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ebabcc071634508511ae2fc7b868ab7"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a3ebabcc071634508511ae2fc7b868ab7">start</a> (const char *name, int stack=DEF_THREAD_STACK, <a class="el" href="../../db/dff/group___enumerations.html#ga51e24e4c0498282f564e92975e020c1d">PRIORITIES_T</a> priority=<a class="el" href="../../db/dff/group___enumerations.html#gga51e24e4c0498282f564e92975e020c1daf8a2513dc9a78bb09c0520af65a3f402">PRI_LOW</a>)</td></tr>
<tr class="separator:a3ebabcc071634508511ae2fc7b868ab7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacf955d1852e74da1f989251955ee6ec"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#aacf955d1852e74da1f989251955ee6ec">start</a> ()</td></tr>
<tr class="separator:aacf955d1852e74da1f989251955ee6ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8c53aa8c145fc4ac70fa6d825b95742"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#ac8c53aa8c145fc4ac70fa6d825b95742">resume</a> ()</td></tr>
<tr class="separator:ac8c53aa8c145fc4ac70fa6d825b95742"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53e71e6db2221cd1c45aec21953d4aad"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a53e71e6db2221cd1c45aec21953d4aad">suspend</a> ()</td></tr>
<tr class="separator:a53e71e6db2221cd1c45aec21953d4aad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0227eda51725b795a461a768703f588"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#ac0227eda51725b795a461a768703f588">getStackHighWaterMark</a> ()</td></tr>
<tr class="separator:ac0227eda51725b795a461a768703f588"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51dbe9909ce528b4113d2cc27314e965"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a51dbe9909ce528b4113d2cc27314e965">isSuspend</a> ()</td></tr>
<tr class="separator:a51dbe9909ce528b4113d2cc27314e965"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e9cce461d8dfb3889cea24f1a703f6f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/dff/group___enumerations.html#ga25ee4013cc565a18ac2f4039b4ad441b">TASK_STATE_T</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a1e9cce461d8dfb3889cea24f1a703f6f">getState</a> ()</td></tr>
<tr class="separator:a1e9cce461d8dfb3889cea24f1a703f6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b0703ae0cc085a0c0aaa55b6945575b"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a6b0703ae0cc085a0c0aaa55b6945575b">setPriority</a> (<a class="el" href="../../db/dff/group___enumerations.html#ga51e24e4c0498282f564e92975e020c1d">PRIORITIES_T</a> p)</td></tr>
<tr class="separator:a6b0703ae0cc085a0c0aaa55b6945575b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac30b0a1f51549a97b88771692319c0e4"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../db/dff/group___enumerations.html#ga51e24e4c0498282f564e92975e020c1d">PRIORITIES_T</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#ac30b0a1f51549a97b88771692319c0e4">getPriority</a> ()</td></tr>
<tr class="separator:ac30b0a1f51549a97b88771692319c0e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa291909bc3ff7cc0decf46c885a7a725"><td class="memItemLeft" align="right" valign="top">LPCTSTR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#aa291909bc3ff7cc0decf46c885a7a725">getName</a> ()</td></tr>
<tr class="separator:aa291909bc3ff7cc0decf46c885a7a725"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a0f0727be4714cef1e24150a869d403"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a4a0f0727be4714cef1e24150a869d403">isAlive</a> ()</td></tr>
<tr class="separator:a4a0f0727be4714cef1e24150a869d403"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15041136818470124d097d790d55a6e5"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a15041136818470124d097d790d55a6e5">kill</a> ()</td></tr>
<tr class="separator:a15041136818470124d097d790d55a6e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2513fd0fcad30e2e6605609c91f1984"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#ab2513fd0fcad30e2e6605609c91f1984">isThread</a> ()</td></tr>
<tr class="separator:ab2513fd0fcad30e2e6605609c91f1984"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a743d4325b7e7da494283f3292773ff77"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a743d4325b7e7da494283f3292773ff77">resumeAll</a> ()</td></tr>
<tr class="separator:a743d4325b7e7da494283f3292773ff77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c09328581bd4e4a3e9e793f3376a92a"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a2c09328581bd4e4a3e9e793f3376a92a">suspendAll</a> ()</td></tr>
<tr class="separator:a2c09328581bd4e4a3e9e793f3376a92a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb4cafe42d6cfc41294cf5dedcee8678"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#aeb4cafe42d6cfc41294cf5dedcee8678">enterCriticalSection</a> ()</td></tr>
<tr class="separator:aeb4cafe42d6cfc41294cf5dedcee8678"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab3a51062666552690be49b8e8027161"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#aab3a51062666552690be49b8e8027161">exitCriticalSection</a> ()</td></tr>
<tr class="separator:aab3a51062666552690be49b8e8027161"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a071c3d3b3c19a7bd6a01aca073a9b4d7"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d26/class_c_thread.html#a071c3d3b3c19a7bd6a01aca073a9b4d7">run</a> ()</td></tr>
<tr class="separator:a071c3d3b3c19a7bd6a01aca073a9b4d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> class is a ble core, and inherits from <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a> class to provide the stream virtual functions for serial input and output. the <a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> class also inherits from the <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> class and can be work in background. </p>
<dl class="section remark"><dt>Remarks</dt><dd>1.The <a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> will use an interrupt resource, so remain 7 interrupts can be used.<br/>
 2.The <a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> will become to a Weakup Source for Power Save Features. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d4/d70/_2ble_2ble_heartrate_2src_2main_8cpp-example.html#_a17">/ble/ble_heartrate/src/main.cpp</a>, <a class="el" href="../../d5/df3/_2ble_2ble_multiple_2src_2main_8cpp-example.html#_a6">/ble/ble_multiple/src/main.cpp</a>, and <a class="el" href="../../d7/d19/_2ble_2ble_proximity_2src_2main_8cpp-example.html#_a8">/ble/ble_proximity/src/main.cpp</a>.</dd>
</dl></div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a835c884c9209b074cf82e5a3f0a322ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bleSerial::bleSerial </td>
          <td>(</td>
          <td class="paramtype">LPCTSTR&#160;</td>
          <td class="paramname"><em>deviceName</em> = <code>DEF_BLE_DEVICENAME</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> constructor with a GAT device name. </p>
<p><a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> constructor </p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> main() {</div>
<div class="line">        ...</div>
<div class="line">        <a class="code" href="../../d7/d03/classble_serial.html">bleSerial</a> ble(<span class="stringliteral">&quot;myBLE&quot;</span>);</div>
<div class="line">        ble.advertising(100);   <span class="comment">// set advertising interval 100ms</span></div>
<div class="line">        ble.enable();</div>
<div class="line">        ...</div>
<div class="line">        ...</div>
</div><!-- fragment --> <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">deviceName</td><td>point to a LPCTSTR string to indicate the GAT device name of Bluetooth. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a0ee4ea2d6d4a38bbd64968336f85c2e9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bleSerial::advertising </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>advInterval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int8_t&#160;</td>
          <td class="paramname"><em>txPowerLevel</em> = <code>DEF_BLE_TXPOWER</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>connInterval</em> = <code>DEF_BLE_CONN_INTERVAL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>connTimeout</em> = <code>DEF_BLE_CONN_TIMEOUT</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>manufactureData</em> = <code>DEF_BLE_MFG_DATA</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Broadcast the advertising message when device is not in BLE connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">advInterval</td><td>To broadcast the advertising message with the interval time in millisecond. </td></tr>
    <tr><td class="paramname">txPowerLevel</td><td>To expose the "TxPowerLevel" on the advertising message. </td></tr>
    <tr><td class="paramname">connInterval</td><td>To expose the "connection interval" on the advertising message. </td></tr>
    <tr><td class="paramname">connTimeout</td><td>To expose the "connection timeout" on the advertising message. </td></tr>
    <tr><td class="paramname">manufactureData</td><td>To expose the "Manufacture Data" on the advertising message. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section remark"><dt>Remarks</dt><dd>advertising(...) have to call before the <a class="el" href="../../d7/d03/classble_serial.html#a3ff1e4b271a7d225e73abd337043d8e4">enable()</a> member. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>The connection interval must be between 8 ms and 4 s. </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="../../d7/d03/classble_serial.html#a835c884c9209b074cf82e5a3f0a322ec" title="bleSerial constructor with a GAT device name. ">bleSerial()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a08b3a82e95aa527433c04b4a6a3d81d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bleSerial::disable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The disable member is to suspend the bleSerail task. </p>
<dl class="section note"><dt>Note</dt><dd>Call enable member to resume the bleSerail task. </dd></dl>

</div>
</div>
<a class="anchor" id="a5e63823fd7ff0ef0ac5447cd265b5a5c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool bleSerial::disconnect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../db/dff/group___enumerations.html#gafdc7d73c1364c4d42f80cfdc702de294">BLE_DISCONNECT_REASON_T</a>&#160;</td>
          <td class="paramname"><em>reason</em> = <code><a class="el" href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a3aaba90cbef710f140a4f7e70d1f0d5b">BLE_TERMINATED</a></code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>To disconnect current connection with a reason. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">reason</td><td>is a BLE_DISCONNECT_REASON_T enumeration. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if disconnect successful, otherwise, disconnect failed. </dd></dl>

</div>
</div>
<a class="anchor" id="a3ff1e4b271a7d225e73abd337043d8e4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool bleSerial::enable </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>stack</em> = <code>128</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The enable member is to call the <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a>:<a class="el" href="../../d0/d26/class_c_thread.html#aacf955d1852e74da1f989251955ee6ec">start()</a> to start the ble engine task. </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;class/ble_serial.h&quot;</span></div>
<div class="line"><span class="keywordtype">int</span> main() {</div>
<div class="line">        <a class="code" href="../../d7/d03/classble_serial.html">bleSerial</a> ble(<span class="stringliteral">&quot;myBLE&quot;</span>);</div>
<div class="line">        ble.enable();   <span class="comment">// to start the BLE core and Task.</span></div>
<div class="line">        ...</div>
<div class="line">        ...</div>
<div class="line">}</div>
</div><!-- fragment --> <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stack</td><td>To indicate the stack size of BLE task. default is 128 bytes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if start the ble task successful, otherwise is failed. </dd></dl>

</div>
</div>
<a class="anchor" id="aeb4cafe42d6cfc41294cf5dedcee8678"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void CThread::enterCriticalSection </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the <a class="el" href="../../d0/d26/class_c_thread.html#aeb4cafe42d6cfc41294cf5dedcee8678">CThread::enterCriticalSection()</a> to disable interrupts. </p>

</div>
</div>
<a class="anchor" id="aab3a51062666552690be49b8e8027161"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void CThread::exitCriticalSection </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the <a class="el" href="../../d0/d26/class_c_thread.html#aab3a51062666552690be49b8e8027161">CThread::exitCriticalSection()</a> to enable interrupts. </p>

</div>
</div>
<a class="anchor" id="ad41b78cc1b0fc02ce65248147b32ffa8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleSerial::flush </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Flush the stream the both input and output buffer </p>
<dl class="section remark"><dt>Remarks</dt><dd>the pure virtual function have to implement by child class. </dd></dl>

<p>Reimplemented from <a class="el" href="../../d4/d16/class_c_stream.html#a5bd707b33627e01c2069b14bbf10694a">CStream</a>.</p>

</div>
</div>
<a class="anchor" id="aa291909bc3ff7cc0decf46c885a7a725"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">LPCTSTR CThread::getName </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to retrieve the task's name. </p>

</div>
</div>
<a class="anchor" id="a6aea16b265aa98f0a540f71b75965408"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t bleSerial::getPhyVersion </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get BLE core hardware version. </p>
<dl class="section return"><dt>Returns</dt><dd>An uint8_t type value. </dd></dl>

</div>
</div>
<a class="anchor" id="ac30b0a1f51549a97b88771692319c0e4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../db/dff/group___enumerations.html#ga51e24e4c0498282f564e92975e020c1d">PRIORITIES_T</a> CThread::getPriority </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to get the task's priority. </p>
<dl class="section return"><dt>Returns</dt><dd>PRIORITIES_T </dd></dl>

</div>
</div>
<a class="anchor" id="ac0227eda51725b795a461a768703f588"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t CThread::getStackHighWaterMark </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to check the stack high water mark. </p>
<dl class="section note"><dt>Note</dt><dd>Or use the shell and type 'task' to check all tasks status. </dd></dl>

</div>
</div>
<a class="anchor" id="a1e9cce461d8dfb3889cea24f1a703f6f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../db/dff/group___enumerations.html#ga25ee4013cc565a18ac2f4039b4ad441b">TASK_STATE_T</a> CThread::getState </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Retrieve the state of thread object (task) </p>

</div>
</div>
<a class="anchor" id="a4a0f0727be4714cef1e24150a869d403"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CThread::isAlive </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>isAlive is to check the thread is in alive (for run-loop) </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d4/d70/_2ble_2ble_heartrate_2src_2main_8cpp-example.html#a9">/ble/ble_heartrate/src/main.cpp</a>, <a class="el" href="../../db/de1/_2misc_2garbage_collector_2src_2main_8cpp-example.html#a4">/misc/garbage_collector/src/main.cpp</a>, and <a class="el" href="../../da/da9/_2rtos_2blink_thread_2src_2main_8cpp-example.html#a4">/rtos/blink_thread/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a1691c5c5655043512bf1c462e6928488"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool bleSerial::isAvailable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Use isAvailable to check the service whether opened by remote (App). </p>
<dl class="section return"><dt>Returns</dt><dd>true, if service is available. otherwise, the service is not in used. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This isAvailable member is an inline function to redirect to the <a class="el" href="../../d7/d03/classble_serial.html#ac42a8f805e6784e0fa2064270b5288a1">writeable()</a> member. </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="../../d7/d03/classble_serial.html#ac42a8f805e6784e0fa2064270b5288a1">writeable</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aebfde0d9a7583cb641ac60f02df7cd77"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool bleSerial::isConnected </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Check the current connection is valid or not. </p>
<dl class="section return"><dt>Returns</dt><dd>true if current connection is valid. </dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>the pure virtual function have to implement by child class. </dd></dl>

<p>Reimplemented from <a class="el" href="../../d4/d16/class_c_stream.html#a7a152e6bda8654064634428d81bd81cb">CStream</a>.</p>

</div>
</div>
<a class="anchor" id="a51dbe9909ce528b4113d2cc27314e965"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CThread::isSuspend </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to check the task is in suspended or not. </p>
<dl class="section return"><dt>Returns</dt><dd>true if task in suspended. otherwise, the task in running. </dd></dl>

</div>
</div>
<a class="anchor" id="a26a76c241a4d62d2efdac57d2cfe4c0f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CObject::isThread </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Check current object that inherits from <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> class or not. </p>
<dl class="section note"><dt>Note</dt><dd>The isTherad() will be override by <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> class. </dd></dl>

<p>Reimplemented in <a class="el" href="../../d0/d26/class_c_thread.html#ab2513fd0fcad30e2e6605609c91f1984">CThread</a>.</p>

</div>
</div>
<a class="anchor" id="ab2513fd0fcad30e2e6605609c91f1984"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CThread::isThread </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="../../d0/d26/class_c_thread.html#ab2513fd0fcad30e2e6605609c91f1984">isThread()</a>, check the class is inherited from <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> </p>

<p>Reimplemented from <a class="el" href="../../dc/dac/class_c_object.html#a26a76c241a4d62d2efdac57d2cfe4c0f">CObject</a>.</p>

</div>
</div>
<a class="anchor" id="a15041136818470124d097d790d55a6e5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CThread::kill </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>kill the thread and the <a class="el" href="../../d0/d26/class_c_thread.html#a4a0f0727be4714cef1e24150a869d403">isAlive()</a> will return false </p>

</div>
</div>
<a class="anchor" id="adb930ce55295ff7eb6ab5bdbeb702749"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleSerial::onConnected </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>An virtual function call by BLE task and occurs when remote (App) is already to connect the BLE device. </p>
<dl class="section remark"><dt>Remarks</dt><dd>To override the virtual, the onConnection of child have to call the onConnection of supper class. <div class="fragment"><div class="line"><span class="keyword">class </span>myBle: <span class="keyword">public</span> <a class="code" href="../../d7/d03/classble_serial.html">bleSerial</a> {</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line">        <span class="comment">// override the onConnected() virtual function</span></div>
<div class="line">        <span class="keyword">virtual</span> <a class="code" href="../../d7/d03/classble_serial.html#adb930ce55295ff7eb6ab5bdbeb702749">onConnected</a>() {</div>
<div class="line">            bleSerial::onConnection();      <span class="comment">// call to parent class</span></div>
<div class="line"></div>
<div class="line">            <span class="comment">// your onConnection event code here:</span></div>
<div class="line">            ...</div>
<div class="line">            ...</div>
<div class="line">        }</div>
<div class="line">    };</div>
</div><!-- fragment --> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df3/_2ble_2ble_multiple_2src_2main_8cpp-example.html#a7">/ble/ble_multiple/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="aa6f5116c8bcf05011a05ad5e2967c318"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleSerial::onDisconnected </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>An virtual function call by BLE task and occurs when remote (App) is already to disconnect the BLE device. </p>
<dl class="section remark"><dt>Remarks</dt><dd>To override the virtual, the onDisconnection of child have to call the onDisconnection of parent class. <div class="fragment"><div class="line"><span class="keyword">class </span>myBle: <span class="keyword">public</span> <a class="code" href="../../d7/d03/classble_serial.html">bleSerial</a> {</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line">        <span class="comment">// override the onConnected() virtual function</span></div>
<div class="line">        <span class="keyword">virtual</span> <a class="code" href="../../d7/d03/classble_serial.html#aa6f5116c8bcf05011a05ad5e2967c318">onDisconnected</a>() {</div>
<div class="line">            bleSerial::onDisconnection();   <span class="comment">// call to parent class</span></div>
<div class="line"></div>
<div class="line">            <span class="comment">// your onDisonnection event code here:</span></div>
<div class="line">            ...</div>
<div class="line">            ...</div>
<div class="line">        }</div>
<div class="line">    };</div>
</div><!-- fragment --> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df3/_2ble_2ble_multiple_2src_2main_8cpp-example.html#a9">/ble/ble_multiple/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8a0622f5d10fe2242978a16b2d1e6ee4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleSerial::onError </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../db/dff/group___enumerations.html#ga6c00522f6a8c33135ee0414877d42c04">BLE_ERR_T</a>&#160;</td>
          <td class="paramname"><em>err</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPCTSTR&#160;</td>
          <td class="paramname"><em>id</em> = <code>&quot;bleSerial&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>An virtual function call by BLE task and occurs when a BLE hardware error. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>is a BLE_ERR_T enumeration. </td></tr>
    <tr><td class="paramname">id</td><td>is a string to point a class name. (for debug) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The onError event is a empty function in <a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> class. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df3/_2ble_2ble_multiple_2src_2main_8cpp-example.html#a12">/ble/ble_multiple/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8af315789cc459a1fde96ac80ca9ffb7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleSerial::onWatchdog </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>An virtual function call by BLE task and occurs when a watchdog timeout on a connection. </p>
<dl class="section remark"><dt>Remarks</dt><dd>The onWatchdog member will call the reset() member function to reset the BLE core. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df3/_2ble_2ble_multiple_2src_2main_8cpp-example.html#a11">/ble/ble_multiple/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="acc833c2eea18af67b57ba641ec58fea7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual CStream::operator char </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Operator 'char', to receive a char from stream. </p>
<div class="fragment"><div class="line"><a class="code" href="../../d8/d1d/class_c_serial.html">CSerial</a> uart;</div>
<div class="line">uart.<a class="code" href="../../d8/d1d/class_c_serial.html#aff7c822bada51065ad52542fb9515be6">enable</a>(19200);</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">char</span> ch;</div>
<div class="line">ch = uart;</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="acbaa22d4608c1a015a20104fde6c8ccf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual CStream::operator uint8_t </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Operator 'uint8_t', to receive a byte from stream. </p>
<div class="fragment"><div class="line"><a class="code" href="../../d8/d1d/class_c_serial.html">CSerial</a> uart;</div>
<div class="line">uart.<a class="code" href="../../d8/d1d/class_c_serial.html#aff7c822bada51065ad52542fb9515be6">enable</a>(19200);</div>
<div class="line"></div>
<div class="line">uint8_t ch;</div>
<div class="line">ch = uart;</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a2c6130bd65b00f278045d8b7b8ea7f84"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a>&amp; CStream::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Operator '&lt;&lt;', to output a byte to stream. </p>
<div class="fragment"><div class="line"><a class="code" href="../../d8/d1d/class_c_serial.html">CSerial</a> uart;</div>
<div class="line">uart.<a class="code" href="../../d8/d1d/class_c_serial.html#aff7c822bada51065ad52542fb9515be6">enable</a>(19200);</div>
<div class="line"></div>
<div class="line">uint8_t ch = 0xA5;</div>
<div class="line">uart &lt;&lt; ch;</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ad2f2d74f0924caa2e863d049fe9ada80"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a>&amp; CStream::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d4/d16/class_c_stream.html">CStream</a> &amp;&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Read a byte from right stream and send to left stream. </p>

</div>
</div>
<a class="anchor" id="af2bd1778d5f5cfab469e5df615e1c8fc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d4/d16/class_c_stream.html">CStream</a>&amp; CStream::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Operator '&gt;&gt;', to input a byte from stream. </p>
<div class="fragment"><div class="line"><a class="code" href="../../d8/d1d/class_c_serial.html">CSerial</a> uart;</div>
<div class="line">uart.<a class="code" href="../../d8/d1d/class_c_serial.html#aff7c822bada51065ad52542fb9515be6">enable</a>(19200);</div>
<div class="line"></div>
<div class="line">uint8_t ch ;</div>
<div class="line">uart &gt;&gt; ch;</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="af56764abe8954430eede10e253f8994f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual uint8_t CStream::read </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Read a byte from stream </p>
<dl class="section return"><dt>Returns</dt><dd>uint8_t (8 bits) data from the stream </dd></dl>

</div>
</div>
<a class="anchor" id="a186e09706d9b6e58a6213ac0b6a220ad"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int bleSerial::read </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>block</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>To read the stream to buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Destination buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Length of destination buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">block</td><td>If true, to block in the read function unit to the indication length (len) be read. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A value to indicate how many data bytes to read. </dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>the pure virtual function have to implement by child class. </dd></dl>

<p>Reimplemented from <a class="el" href="../../d4/d16/class_c_stream.html#a80977482ffb2f7b626a9f29f437b7d8d">CStream</a>.</p>

</div>
</div>
<a class="anchor" id="a59dca8e3e2d6945a699347f4c4708fd4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int bleSerial::readable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Determine how many data bytes are available to read. </p>
<dl class="section return"><dt>Returns</dt><dd>A value to indicate how many data byte is available in the input buffer. </dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>the pure virtual function have to implement by child class. </dd></dl>

<p>Reimplemented from <a class="el" href="../../d4/d16/class_c_stream.html#a96328807241e15017868b845b06fd9e4">CStream</a>.</p>

</div>
</div>
<a class="anchor" id="ac8c53aa8c145fc4ac70fa6d825b95742"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CThread::resume </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to resume the thread.</p>
<div class="fragment"><div class="line">Example:</div>
<div class="line">    <span class="keywordtype">int</span> main() {</div>
<div class="line">        ...</div>
<div class="line">        CLedTask ledTask;</div>
<div class="line">        ledTask.start(<span class="stringliteral">&quot;led&quot;</span>);</div>
<div class="line">        ...</div>
<div class="line">        ledTask.suspend();      <span class="comment">// suspend the ledTask</span></div>
<div class="line">        ...</div>
<div class="line">        <span class="keywordflow">if</span> ( ledTask.isSuspend() ) {</div>
<div class="line">            ledTask.resume();   <span class="comment">// resume the ledTask</span></div>
<div class="line">        }</div>
<div class="line">        ...</div>
<div class="line">    }</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a743d4325b7e7da494283f3292773ff77"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void CThread::resumeAll </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the <a class="el" href="../../d0/d26/class_c_thread.html#a743d4325b7e7da494283f3292773ff77">CThread::resumeAll()</a> to resume all suspended tasks. </p>

</div>
</div>
<a class="anchor" id="a071c3d3b3c19a7bd6a01aca073a9b4d7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CThread::run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>The run member function is the task main procedure, and callback by RTOS when task start.</p>
<div class="fragment"><div class="line">Example:</div>
<div class="line">        <span class="keyword">class </span>CLedTask: <span class="keyword">public</span> <a class="code" href="../../d0/d26/class_c_thread.html">CThread</a> {</div>
<div class="line">        <span class="keyword">protected</span>:</div>
<div class="line">            <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d0/d26/class_c_thread.html#a071c3d3b3c19a7bd6a01aca073a9b4d7">run</a>() {</div>
<div class="line">                <a class="code" href="../../d7/db9/class_c_pin.html">CPin</a> led(<a class="code" href="../../db/dff/group___enumerations.html#gga65a2241721e4acb573e0c3fe29ac432fa8379bbaa96d151e6adac488b2a147b7a">LED2</a>);</div>
<div class="line">                <span class="keywordflow">while</span>( <a class="code" href="../../d0/d26/class_c_thread.html#a4a0f0727be4714cef1e24150a869d403">isAlive</a>() ) {    <span class="comment">// check thread alive</span></div>
<div class="line">                    led = !led;</div>
<div class="line">                    sleep(200);</div>
<div class="line">                }</div>
<div class="line">            }</div>
<div class="line">        };</div>
<div class="line"></div>
<div class="line">        <span class="keywordtype">int</span> main() {</div>
<div class="line">            ...</div>
<div class="line">            CLedTask ledTask;</div>
<div class="line">            ledTask.start(<span class="stringliteral">&quot;led&quot;</span>);   <span class="comment">// default stack=128, default priority=low</span></div>
<div class="line">            ...</div>
<div class="line">        }</div>
</div><!-- fragment --> <dl class="section remark"><dt>Remarks</dt><dd>The <a class="el" href="../../d0/d26/class_c_thread.html#a071c3d3b3c19a7bd6a01aca073a9b4d7">run()</a> is a pure virtual function, must implement by inheritor. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>if end the <a class="el" href="../../d0/d26/class_c_thread.html#a071c3d3b3c19a7bd6a01aca073a9b4d7">run()</a> member function, the <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> object will be destroyed and collected. </dd></dl>

<p>Reimplemented in <a class="el" href="../../d4/d37/class_c_debug.html#a9a3e40cc8ee5d0c2a41577f658779c71">CDebug</a>, and <a class="el" href="../../de/dba/class_c_shell.html#a1565a93fad9a1e35e05a597889ad130f">CShell</a>.</p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d4/d70/_2ble_2ble_heartrate_2src_2main_8cpp-example.html#a2">/ble/ble_heartrate/src/main.cpp</a>, <a class="el" href="../../db/de1/_2misc_2garbage_collector_2src_2main_8cpp-example.html#a2">/misc/garbage_collector/src/main.cpp</a>, <a class="el" href="../../d1/d0a/_2peripheral_2uart_2src_2main_8cpp-example.html#a2">/peripheral/uart/src/main.cpp</a>, <a class="el" href="../../d0/d46/_2peripheral_2watchdog_2src_2main_8cpp-example.html#a1">/peripheral/watchdog/src/main.cpp</a>, and <a class="el" href="../../da/da9/_2rtos_2blink_thread_2src_2main_8cpp-example.html#a1">/rtos/blink_thread/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6b0703ae0cc085a0c0aaa55b6945575b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CThread::setPriority </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../db/dff/group___enumerations.html#ga51e24e4c0498282f564e92975e020c1d">PRIORITIES_T</a>&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to change the task's priority. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>is PRIORITIES_T to set a new priority for the task. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="acddad359ad714bd31358c96966839a61"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool bleSerial::setRadioTxPower </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../db/dff/group___enumerations.html#ga3b6d6db9e13e93ae21f2a383d9903617">BLE_TX_POWER_T</a>&#160;</td>
          <td class="paramname"><em>power</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the ouptut power level of the Bluetooth Low Energy radio. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">power</td><td>is a BLE_TX_POWER_T enumeration. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if set radio power successful, otherwise is failed. </dd></dl>

</div>
</div>
<a class="anchor" id="acc1e214474c9e98705fb7f363a3eee74"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void bleSerial::setup </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>advInterval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int8_t&#160;</td>
          <td class="paramname"><em>txPowerLevel</em> = <code>DEF_BLE_TXPOWER</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>connInterval</em> = <code>DEF_BLE_CONN_INTERVAL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>connTimeout</em> = <code>DEF_BLE_CONN_TIMEOUT</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>manufactureData</em> = <code>DEF_BLE_MFG_DATA</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>An inline function redirect to <a class="el" href="../../d7/d03/classble_serial.html#a0ee4ea2d6d4a38bbd64968336f85c2e9">advertising()</a> member function. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="../../d7/d03/classble_serial.html#a0ee4ea2d6d4a38bbd64968336f85c2e9">advertising</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a3ebabcc071634508511ae2fc7b868ab7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CThread::start </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stack</em> = <code>DEF_THREAD_STACK</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../db/dff/group___enumerations.html#ga51e24e4c0498282f564e92975e020c1d">PRIORITIES_T</a>&#160;</td>
          <td class="paramname"><em>priority</em> = <code><a class="el" href="../../db/dff/group___enumerations.html#gga51e24e4c0498282f564e92975e020c1daf8a2513dc9a78bb09c0520af65a3f402">PRI_LOW</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to start the thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>is a descriptive name for the task. </td></tr>
    <tr><td class="paramname">stack</td><td>is a integer value to specified as the number of stack can hold-not the number of bytes. </td></tr>
    <tr><td class="paramname">priority</td><td>at which the task should run. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful; otherwise, crate task failed.</dd></dl>
<div class="fragment"><div class="line">Example:</div>
<div class="line">        <span class="keyword">class </span>CLedTask: <span class="keyword">public</span> <a class="code" href="../../d0/d26/class_c_thread.html">CThread</a> {</div>
<div class="line">        <span class="keyword">protected</span>:</div>
<div class="line">            <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d0/d26/class_c_thread.html#a071c3d3b3c19a7bd6a01aca073a9b4d7">run</a>() {</div>
<div class="line">                <a class="code" href="../../d7/db9/class_c_pin.html">CPin</a> led(<a class="code" href="../../db/dff/group___enumerations.html#gga65a2241721e4acb573e0c3fe29ac432fa8379bbaa96d151e6adac488b2a147b7a">LED2</a>);</div>
<div class="line">                <span class="keywordflow">while</span>( <a class="code" href="../../d0/d26/class_c_thread.html#a4a0f0727be4714cef1e24150a869d403">isAlive</a>() ) {    <span class="comment">// Is thread in alive?  (when thread be kill, the isAlive will return false)</span></div>
<div class="line">                    led = !led;</div>
<div class="line">                    sleep(200);</div>
<div class="line">                }</div>
<div class="line">            }</div>
<div class="line">        };</div>
<div class="line"></div>
<div class="line">        <span class="keywordtype">int</span> main() {</div>
<div class="line">            ...</div>
<div class="line">            CLedTask ledTask;</div>
<div class="line">            ledTask.start(<span class="stringliteral">&quot;led&quot;</span>);   <span class="comment">// default stack=128, default priority=low</span></div>
<div class="line">            ...</div>
<div class="line">        }</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="aacf955d1852e74da1f989251955ee6ec"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CThread::start </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to start the thread. </p>
<dl class="section note"><dt>Note</dt><dd>the <a class="el" href="../../d0/d26/class_c_thread.html#aacf955d1852e74da1f989251955ee6ec">start()</a> is an overload member function of <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a>. </dd></dl>

<p>Reimplemented in <a class="el" href="../../d4/d37/class_c_debug.html#a40d1b7f50b76311b3a7fb148e5b7e2ea">CDebug</a>, and <a class="el" href="../../de/dba/class_c_shell.html#a670f66f552494dfce94ee297ae0f659a">CShell</a>.</p>

</div>
</div>
<a class="anchor" id="a53e71e6db2221cd1c45aec21953d4aad"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CThread::suspend </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the member function to suspend the thread.</p>
<div class="fragment"><div class="line">Example:</div>
<div class="line">    <span class="keywordtype">int</span> main() {</div>
<div class="line">        ...</div>
<div class="line">        CLedTask ledTask;</div>
<div class="line">        ledTask.start(<span class="stringliteral">&quot;led&quot;</span>);</div>
<div class="line">        ...</div>
<div class="line">        ledTask.suspend();      <span class="comment">// suspend the ledTask</span></div>
<div class="line">        ...</div>
<div class="line">        <span class="keywordflow">if</span> ( ledTask.isSuspend() ) {</div>
<div class="line">            ledTask.resume();   <span class="comment">// resume the ledTask</span></div>
<div class="line">        }</div>
<div class="line">        ...</div>
<div class="line">    }</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a2c09328581bd4e4a3e9e793f3376a92a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void CThread::suspendAll </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call the <a class="el" href="../../d0/d26/class_c_thread.html#a2c09328581bd4e4a3e9e793f3376a92a">CThread::suspendAll()</a> to suspend all running tasks. </p>

</div>
</div>
<a class="anchor" id="a2588b21bf80d35a866dc7e47f97142df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bleSerial::watchdog </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>tm</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enable a watchdog on a BLE connection. The watchdog feature will cause the BLE core reset when remote (App) crash or lose the connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tm</td><td>A timeout value in millisecond, recommend value is 500~30000. If set the tm to zero, it is meant to disable the watchdog. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The member is an optional function, and default is 10,000ms (10 seconds). </dd></dl>

</div>
</div>
<a class="anchor" id="a48041fea5cad32feaeef543bcaa2d37d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CStream::write </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Write a byte to stream </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>is a uint8_t data to send to the stream. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab9d147e7dcb9436f390f2ad29d539930"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int bleSerial::write </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>block</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>To write the buffer to stream. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Source buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Length of source buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">block</td><td>If true, to block in the write function unit to the indication length (len) be sent. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A value to indicate how many data bytes to write. </dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>the pure virtual function have to implement by child class. </dd></dl>

<p>Reimplemented from <a class="el" href="../../d4/d16/class_c_stream.html#a172fe857c74488b881007c65cc2e9552">CStream</a>.</p>

</div>
</div>
<a class="anchor" id="ac42a8f805e6784e0fa2064270b5288a1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int bleSerial::writeable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Determine how many data space are available to write. </p>
<dl class="section return"><dt>Returns</dt><dd>A value to indicate how many data space is available in the output buffer. </dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>the pure virtual function have to implement by child class. </dd></dl>

<p>Reimplemented from <a class="el" href="../../d4/d16/class_c_stream.html#a56ec27ee664f1a4eb9910988b78833d5">CStream</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d03/classble_serial.html">bleSerial</a></li>
    <li class="footer">Generated on Fri Apr 11 2014 23:43:26 for uCXpresso.BLE by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
